import Vue from 'vue'
import Router from 'vue-router'
// import HelloWorld from '@/components/HelloWorld'
import Login from '@/components/login/Login.vue'
const Index = () => import("@/components/product/Index.vue")

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: "/product/index",
    },
    {
      path: '/',
      name: 'Index',
      component: Index,
      redirect: "/product/index",
      meta: {
        title: "首页",
        requireAuth: true
      },
      children: [
        {
          path: "/product/index",
          name: "index",
          component: () => import("../components/product/componented/goosd.vue")
        },
        {
          path: "/user/index",
          name: "user",
          component: () => import("../components/product/componented/user.vue")
        },
        {
          path: "/product/index/indexs",
          name: "goods",
          component: () => import("../components/product/componented/price.vue")
        },
        {
          path: "/product/save",
          name: "addsave",
          component: () => import("../components/product/componented/addsave.vue")
        },
        {
          path: "/product/updata/:id?",
          name: "updaatasave",
          component: () => import("../components/product/componented/upsave.vue")
        },
        {
          path: "/product/detail/:id?",
          name: "detail",
          component: () => import("../components/product/componented/checkdetail.vue")
        },
        {
          path: "/product-category/index",
          name: "Pcategory",
          component: () => import("../components/product/componented/category.vue")
        },
        {
          path: "/product-category/add",
          name: "addcategory",
          component: () => import("../components/product/componented/addcategory.vue")
        },


        {
          path: "/order/index",
          name: "Orderlist",
          component: () => import("../components/order/list.vue")
        },
        {
          path: "/order/detail/:id?",
          name: "Orderdetail",
          component: () => import("../components/order/detail.vue")
        },
      ]
    },
    {
      path: '/login',
      name: "Login",
      component: Login,
    },
  ]
})
